package com.syx.rabbitmqspring.Listener;

import com.syx.rabbitmqspring.Constant.Constants;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;



@Component
public class WorkListener {

    //监听要接收的队列,只要有消息就会立马进行监听
    @RabbitListener(queues = Constants.WORK_QUEUE)
    public void queueListener1(Message message){

        System.out.println(Constants.WORK_QUEUE+"listen1接收到消息"+message);


    }
    @RabbitListener(queues = Constants.WORK_QUEUE)
    public void queueListener2(Message message){

        System.out.println(Constants.WORK_QUEUE+"listen2接收到消息"+message);

    }








}
